<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Overflow background-attachment Demo</title>
    <style>
        body {
            margin: 0;
            font-size: 4rem;
            text-transform: capitalize;

            height: 200vh;

            display: flex;
            justify-content: center;
            align-items: center;
            flex-direction: column;
        }
        h2 {
            text-align: center;
            margin-top: 48px;
        }
        div {
            height: 300px;
            width: 50%;
            max-width: 600px;

            overflow-x: hidden;
            overflow-y: scroll;
        }

        .scroll {
            background: url("./book.jpeg");
            background-size: cover;
            background-attachment: scroll;
        }
        .fixed {
            background: url("./book.jpeg");
            background-size: cover;
            background-attachment: fixed;
        }
        .local {
            background: url("./book.jpeg");
            background-size: cover;
            background-attachment: local;
        }
    </style>
</head>
<body>
    <h2><code>scroll</code></h2>
    <div class="scroll">The background-attachment CSS property sets whether a background image's position is fixed within the viewport, or scrolls with its containing block.</div>

    <h2><code>fixed</code></h2>
    <div class="fixed">The background-attachment CSS property sets whether a background image's position is fixed within the viewport, or scrolls with its containing block.</div>

    <h2><code>local</code></h2>
    <div class="local">The background-attachment CSS property sets whether a background image's position is fixed within the viewport, or scrolls with its containing block.</div>
</body>
</html>
